﻿using System;
using System.Collections.Generic;
using RehabilitationMvc.DataAccess;

namespace RehabilitationMvc.Classes
{
    /// <summary>
    /// Custom dependency resolver for MVC and Web API.
    /// </summary>
    public class RehabilitationResolver : System.Web.Http.Services.IDependencyResolver, System.Web.Mvc.IDependencyResolver
    {
        static private readonly IRehabilitationRepository RehabilitationRepository = new RehabilitationRepository();


        public object GetService(Type serviceType)
        {
            if (serviceType == typeof(Controllers.ReviewsController))
            {
                return new Controllers.ReviewsController(RehabilitationRepository);
            }
            return null;
        }

        public IEnumerable<object> GetServices(Type serviceType)
        {
            return new List<object>();
        }
    }
}